/* @author Stone at GDOU
   @date May 2021
   @brief A PID utility
 */
 
#ifndef PID_H
#define PID_H 

#define MAX_I_ITEM 400

 
 class PID 
 {
 public:
    float kp, ki, kd;
    float p_item, i_item, d_item;  // these member are used for inspection purpose
    float target, last_err, integ_err;
    float out;
    
    PID(float kp=0, float ki=0, float kd=0, float target=0);
    void Update(float x);
    void ClearHistory();
    
 };
 
 
#endif  // PID_H 

 


